package oa.service.impl;

import java.util.Collection;
import java.util.Set;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import oa.dao.PrivilegeDao;
import oa.dao.RoleDao;
import oa.domain.system.Privilege;
import oa.domain.system.Role;
import oa.service.PrivilegeService;
@Service("privilegeService")
public class PrivilegeServiceImpl implements PrivilegeService {

	@Resource(name="privilegeDao")
	private PrivilegeDao privilegeDao;

	@Override
	public Collection<Privilege> getPrivilegeByRid(Long rid) {
		// TODO Auto-generated method stub
		return this.privilegeDao.getPrivileges(rid);
	}
	
	@Override
	public Set<Privilege> getPrivilegeByRid(String checkedStr) {
		// TODO Auto-generated method stub
		return this.privilegeDao.getEntryByIds(checkedStr);
	}

	@Override
	public Collection<Privilege> getPrivilegesByUid(Long uid,String username) {
		// TODO Auto-generated method stub
		
		return this.privilegeDao.getMenuitemsByUid(uid,username);
	}

	@Override
	public Collection<Privilege> getFunctionsByUid(Long uid) {
		// TODO Auto-generated method stub
		return this.privilegeDao.getFunctionByUid(uid);
	}

}
